package com.digitalchina.trade.mapper;

import com.digitalchina.trade.entity.TbAccount;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AccountMapper {
    /**
     * 登录
     * @param tbAccount 账户
     * @return TbAccount 账户对象
    * */

    TbAccount login(@Param("account") TbAccount tbAccount);

    /**
     * 保存账户
     * @param account 账户对象
     * @return int 账户主键
     * */

    int saveAccount(@Param("account") TbAccount account);

    /**
     * 更改账户
     * @param account 账户对象
     * */
    void updateAccount(@Param("account") TbAccount account);
    /**
     *
     * @auther xiaoming
     * @date 2021/6/14 9:30
     * @param accountName 根据账户名查找账户
     * @return com.digitalchina.trade.entity.TbAccount
     */
    TbAccount selectByAccountName(String accountName);
    /**
     *
     * @auther xiaoming
     * @date 2021/6/14 9:32
     * @param accountCradNum 根据身份证查找账户
     * @return com.digitalchina.trade.entity.TbAccount
     */
    TbAccount selectByAccountCradNum(String accountCradNum);
    /**
     *
     * @auther xiaoming
     * @date 2021/6/14 9:33
     * @param accountEmail 根据邮箱查找账户
     * @return com.digitalchina.trade.entity.TbAccount
     */
    TbAccount selectByAccountEmail(String accountEmail);
    /**
     *
     * @auther xiaoming
     * @date 2021/6/14 9:34
     * @param accountPhoneNum 根据电话查找账户
     * @return com.digitalchina.trade.entity.TbAccount
     */
    TbAccount selectByAccountPhoneNum(String accountPhoneNum);


    /**
     * 查出所有账户
     * @return
     */
    TbAccount getOne(String account_name);

    List<TbAccount> getAll();

}
